using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;

public partial class site : System.Web.UI.MasterPage
{
  protected void Page_Load(object sender, EventArgs e)
  {
		if (Page.User.Identity.IsAuthenticated)
		{
			aLogin.InnerText = Resources.labels.logoff;
			aLogin.HRef = BlogEngine.Core.Utils.RelativeWebRoot + "login.aspx?logoff";
		}
		else
		{
			aLogin.HRef = BlogEngine.Core.Utils.RelativeWebRoot + "login.aspx";
			aLogin.InnerText = Resources.labels.login;
		}


        Page.Header.Controls.Add(new LiteralControl(string.Concat("<!--[if IE 6]><link rel='stylesheet' href='", template_url(), "/ie60.css' type='text/css' media='screen' /><![endif]-->"))); 
      //<%=()%>
  }

  protected string template_url()
  {
      string query = Request.QueryString["theme"];
      string theme = !string.IsNullOrEmpty(query) ? query : BlogEngine.Core.BlogSettings.Instance.Theme;
      return string.Concat(BlogEngine.Core.Utils.RelativeWebRoot, "themes/", theme);

  }

}
